@cd %~dp0

@if not exist "%EPOMDIR%\pgr5.exe" goto EPOM_ERROR

@set make_cmd=cs-make
@set make_option=-s IS_USE_PGRELIEF=y
@set make_logfile=log.txt
@set make_logout=logoutput.exe %make_logfile%
@set make_dir=Project

@if exist %make_logfile% del /f %make_logfile%
@if exist .\PGRelief_out.csv del /f .\PGRelief_out.csv


:UPDATE
@echo Building (Only updated files) ...
@set make_target=target
@%make_cmd% %make_option% %make_target% -C %make_dir% 2>>&1 | %make_logout%

@if exist .\PGRelief_out.csv .\project\PGReliefCheck.exe .\PGRelief_out.csv 2

@echo %0
@echo complete !

@goto EXIT


:EPOM_ERROR
@echo.
@echo "pgr5.exe" is not found.
@echo Please set "EPOMDIR" environment variable.
@goto EXIT


:ERROR
@echo error !
@echo press any key to close.
@pause > nul



:EXIT
